/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.s2aei.view;

import com.s2aei.controller.AdminController;
import com.s2aei.model.Usuario;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author Christian
 */
public class JanelaInicial extends javax.swing.JFrame {

    /**
     * Creates new form JanelaInicial
     */
    public JanelaInicial() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        MenuBar = new javax.swing.JMenuBar();
        CadastrarMenu = new javax.swing.JMenu();
        cadAdmMenuItem = new javax.swing.JMenuItem();
        jMenuItem2 = new javax.swing.JMenuItem();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        listAdmMenuItem = new javax.swing.JMenuItem();
        jMenuItem4 = new javax.swing.JMenuItem();
        jMenuItem3 = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        CadastrarMenu.setText("Cadastrar");

        cadAdmMenuItem.setText("Cadastrar Administrador");
        cadAdmMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cadAdmMenuItemActionPerformed(evt);
            }
        });
        CadastrarMenu.add(cadAdmMenuItem);

        jMenuItem2.setText("Cadastrar Avaliador");
        jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem2ActionPerformed(evt);
            }
        });
        CadastrarMenu.add(jMenuItem2);

        jMenuItem1.setText("Cadastrar Professor");
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        CadastrarMenu.add(jMenuItem1);

        MenuBar.add(CadastrarMenu);

        jMenu2.setText("Listar");

        listAdmMenuItem.setText("Administradores");
        listAdmMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                listAdmMenuItemActionPerformed(evt);
            }
        });
        jMenu2.add(listAdmMenuItem);

        jMenuItem4.setText("Avaliadores");
        jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem4ActionPerformed(evt);
            }
        });
        jMenu2.add(jMenuItem4);

        jMenuItem3.setText("Professores");
        jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem3ActionPerformed(evt);
            }
        });
        jMenu2.add(jMenuItem3);

        MenuBar.add(jMenu2);

        setJMenuBar(MenuBar);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 593, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 325, Short.MAX_VALUE)
        );

        setSize(new java.awt.Dimension(609, 384));
        setLocationRelativeTo(null);
    }// </editor-fold>//GEN-END:initComponents

    private void cadAdmMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cadAdmMenuItemActionPerformed
        JanelaCadastroAdm janela = new JanelaCadastroAdm();
        janela.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
        janela.setVisible(true);
        janela.getEditarBtn().setVisible(false);
        janela.getExcluirBtn().setVisible(false);
        janela.getIdField().setVisible(false);
        janela.getLabelId().setVisible(false);
    }//GEN-LAST:event_cadAdmMenuItemActionPerformed

    private void listAdmMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_listAdmMenuItemActionPerformed
        JanelaListarAdm janela = new JanelaListarAdm();
        janela.preencheTabela();
        janela.setVisible(true);
    }//GEN-LAST:event_listAdmMenuItemActionPerformed

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
        JanelaCadastroProfessor janela = new JanelaCadastroProfessor();
        janela.setVisible(true);
        janela.getEditarBtn().setVisible(false);
        janela.getExcluirBtn().setVisible(false);
        janela.getIdField().setVisible(false);
        janela.getLabelId().setVisible(false);
    }//GEN-LAST:event_jMenuItem1ActionPerformed

    private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
        JanelaCadastroAvaliador janela = new JanelaCadastroAvaliador();
        janela.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
        janela.setVisible(true);
        janela.getEditarBtn().setVisible(false);
        janela.getExcluirBtn().setVisible(false);
        janela.getIdField().setVisible(false);
        janela.getLabelId().setVisible(false);
    }//GEN-LAST:event_jMenuItem2ActionPerformed

    private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed
        JanelaListarProfessores janela = new JanelaListarProfessores();
        janela.preencheTabela();
        janela.setVisible(true);
    }//GEN-LAST:event_jMenuItem3ActionPerformed

    private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed
        JanelaListarAvaliadores janela = new JanelaListarAvaliadores();
        janela.preencheTabela();
        janela.setVisible(true);
    }//GEN-LAST:event_jMenuItem4ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(JanelaInicial.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(JanelaInicial.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(JanelaInicial.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(JanelaInicial.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new JanelaInicial().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenu CadastrarMenu;
    private javax.swing.JMenuBar MenuBar;
    private javax.swing.JMenuItem cadAdmMenuItem;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JMenuItem listAdmMenuItem;
    // End of variables declaration//GEN-END:variables
}
